/*
 * @Author: ZhaoZhiqi
 * @Date: 2022-09-07 16:11:59
 * @LastEditors: ZhaoZhiqi
 * @LastEditTime: 2022-09-09 14:51:04
 * @Description: 我的收藏和浏览记录
 * @FilePath: \tuanfeng-mini\src\api\collection.js
 */
import request from "./request";

/**
 * @description: 新增收藏/浏览记录 
 * @param {string} openId 
 * @return {*}
 */
export function collectAPI(data) {
    return request(`mine/addRecordAndCollect`, 'POST', data) 
}

/**
 * @description: 取消收藏 
 * @param {string} openId 
 * @param {number} type 类型 0浏览记录 1收藏
 * @param {string} id 
 * @return {*}
 */
 export function cancelCollectAPI(data) {
    return request(`mine/cancelCollect`, 'GET', data) 
}

/**
 * @description: 查询收藏/浏览记录
 * @param {string} openId
 * @param {number} type 类型 0浏览记录 1收藏
 * @return {*}
 */
export function getCollectionAPI(data) {
    return request(`mine/getRecordOrCollect`, 'GET', data) 
}